home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / bridge / CropPic.rx < prev    next >
Text File  |  2002-12-18  |  914b  |  59 lines

  1. /*     arexx Script 
  2.     Crop Anim
  3. */
  4.  
  5.     options results
  6.     parse ARG Port CropX CropY CropW CropH b
  7.     
  8.     ADDRESS value Port
  9.     /*pp_AvoidRefresh*/
  10.  
  11.     pp_GetWidth
  12.     W=result
  13.     pp_GetHeight
  14.     H=result
  15.  
  16.     pp_GetWidthB
  17.     Wb=result
  18.     IsBrush=0
  19.     IF Wb>0 then DO
  20.         IsBrush=1
  21.         pp_Bsave "perfectpaint:Temp/brush" 0 3
  22.     END
  23.  
  24.     X2=CropW/2
  25.     Y2=CropH/2    
  26.  
  27.     pp_CountFrames
  28.     nb=result
  29.     if nb>1 then do
  30.         Do i=1 to nb
  31.             pp_GotoFrame i
  32.             pp_PickBrush CropX CropY CropW CropH 1
  33.             pp_Bsave 'PerfectPaint:Temp/Anim'||i 0 1
  34.             pp_GetJiffies
  35.             J.i=result
  36.         END
  37.  
  38.         pp_New CropW CropH
  39.         pp_MakeAnim nb 0
  40.         pp_Bload 'PerfectPaint:Temp/Anim1'
  41.         pp_Plot X2 Y2
  42.         pp_SetJiffies 1 J.1        
  43.  
  44.         do i=2 to nb
  45.             pp_Bload 'PerfectPaint:Temp/Anim'||i
  46.             pp_NextFrame
  47.             pp_Plot X2 Y2
  48.             pp_SetJiffies i J.i        
  49.         END
  50.         pp_FreeBrush
  51.         IF IsBrush=1 then DO
  52.             pp_Bload "perfectpaint:Temp/brush"
  53.         END
  54.         
  55.         ADDRESS COMMAND    'delete >nil: PerfectPaint:Temp/?#.*'
  56.         EXIT
  57.     END
  58.  
  59.